from miller_rabin import is_prime
    
def corners(side): 
    base = (side - 2) ** 2
    return [base + n * (side - 1) for n in xrange(1,5)]

nrCorners = 1
nrPrimes = 0
side = 1

while True:
    side += 2
    next = corners(side)
    nrCorners += 4
    
    nrPrimes += len(filter(is_prime, next))
    
    if nrPrimes * 10 < nrCorners:
        print side, nrPrimes, nrCorners, next
        break
